1. Technical Field
One or more embodiments of the present disclosure relate generally to curve editing systems. More specifically, one or more embodiments of the present disclosure relate to systems and methods for enhancing curves by using non-uniformly scaled cubic variation of curvature (CVC) curves.
2. Background and Relevant Art
Conventional curve editing systems enable users to design smooth curves for purposes such as free form illustration, engineering design, or other types of technical or non-technical drawing. Curves generated by these conventional systems are often referred to as “splines.” A spline is a continuous curve made up of smaller curve elements called “curve primitives” (or simply “curves”). Curve primitives are smoothly joined end to end in a spline so that the spline appears as one long continuous curve. Conventional systems compute each curve primitive as a compact mathematical equation using a fixed number of parameters. For example, conventional systems often define a conic curve using five parameters, a quadratic Bézier curve using six parameters, and a cubic Bézier curve using eight parameters.
As an overview, conventional systems provide a user interface that enables users to specify spines by interacting with a display and an input device. Typically, conventional systems enable a user to edit (e.g., create and drag) discrete points, which in turn, control the shape of the spines. Hence, these discrete points are called control points. Control points can include interpolated control points and non-interpolated control points. Interpolated control points are located on a curve and directly constrain the curve. Non-interpolated control points control the tangent to the curve and are associated with a nearby interpolated control point. Moving a non-interpolated control point, changes the direction of the curve at the associated interpolated control point. As used herein, an interpolated control point can be an end point or an intermediary control point.
One problem with simpler conventional systems, ones that use only interpolated control points, is that such systems have to supply tangent angles at the control points. It is often difficult to supply tangent angles that anticipate the user's desires, which causes some of the drawbacks of such systems. Some conventional systems have recently improved the ability to draw and create curves and splines. For example, these systems use Bézier curves in attempts to create natural looking curves. In some cases, these conventional systems use quadratic Bézier curve fit to control points within a curve to achieve a better looking curve. Despite these improvements, such conventional systems still suffer from a number of drawbacks.
As one example of a drawback, these conventional systems typically only provide G1 continuity for a spline. “G1 continuity” refers to a measure of curve smoothness where two curves connect (typically in a spline) such that the tangent angles of the two curves match at the connection. Curves in a spline, however, can achieve G2 continuity, where the curvature in also continuous across different curves in a spline. More specifically, “G2 continuity” refers to a measure of curve smoothness where two different curves connect such that both the tangent angles and the curvatures of the two curves match at the connection. Splines with G2 continuity often have more an aesthetic appeal than splines with only G1 continuity because the curvature of G2 continuity curves tend to change more gradually. Many applications, including some engineering applications, require G2 continuity in curves, which many conventional systems cannot provide.
As another example of a drawback, some conventional systems that use Bézier curves place control points in the center of a curve primitive. As a result, the curve between two control points consists of two halves of two quadratic Bézier curves. This can result in a conflict with existing systems, which require one primitive between control points. As a result, this issue makes backwards compatibility more difficult.
As a further problem, conventional systems that use Bézier curves often return unsuitable results. In particular, cubic Bézier curves each theoretically have enough degrees of freedom to set both the tangent and curvature at both end points. In reality, however, after the end points and tangent directions are fixed in a Bézier curve, the remaining degrees of freedom are constrained by the solutions of a quartic polynomial equation. This can result occasionally in more than one valid solution, or in some cases, no valid solutions (e.g., not all roots of the polynomial are real or the roots do not align with the curve direction). Conventional systems often break or fail when provided with one of these unsuitable solutions.
Moreover, even when conventional systems arrive at a correct result for a curve, the curve is sometimes not fair. As used herein, “fair” or “fairness” refers to the aesthetic look of a curve. A “fair” curve looks pleasing and aesthetic to the eye. The terms “roundness” and “fullness” can also be used to describe the fairness of a curve. Fairness is heuristically achieved by minimizing the amount of change if curvature in a curve. The term “curvature” refers to the rate of change of a tangent angle of the curve as a function of arc length. For example, for a circle of radius R the curvature is constant at 1/R. Intuitively the higher the curvature is at a point, the more sharply the curve turns at that point. Note, that curvature can be positive or negative. Conventionally, a curve whose direction is changing in a counter-clockwise direction as one travels along the curve is positive and changing in a clockwise direction is negative. As mentioned above, conventional systems can provide a cubic curve that is not fair in high-curvature curves because the curvature can vary too quickly along the curve. In other words, even when a conventional system can produce a curve with G2 continuity, the conventional system can produce curves that are not aesthetically pleasing or fair.
Thus, these and other problems exist with regard to creating and enhancing curves.